﻿using System.ComponentModel.DataAnnotations;

namespace ManagementApi.Models.BankTransfer;

/// <summary>
/// 批量代发批次创建（普通渠道）
/// </summary>
public class CreateBatchSalaryPaymentReq
{
    /// <summary>
    /// 工资流水号（渠道流水号）
    /// </summary>
    [Display(Name = "工资流水号")]
    [Required(ErrorMessage = "{0}不能为空")]
    public string TranNo { get; set; } = string.Empty;

    /// <summary>
    /// 渠道时间
    /// </summary>
    [Display(Name = "渠道时间")]
    public DateTime TranTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 付款人账号（单位结算账户）
    /// </summary>
    [Display(Name = "专户账号")]
    [Required(ErrorMessage = "{0}不能为空")]
    public string PayerAcctNo { get; set; } = string.Empty;

    /// <summary>
    /// 付款人户名（单位结算账户户名）
    /// </summary>
    [Display(Name = "专户户名")]
    [Required(ErrorMessage = "{0}不能为空")]
    public string PayerAcctName { get; set; } = string.Empty;

    public List<SalaryPaymentDetail> Details { get; set; } = new();
}

public class SalaryPaymentDetail
{
    /// <summary>
    /// 工人银行卡号
    /// </summary>
    public string BankCardNo { get; set; } = string.Empty;

    /// <summary>
    /// 工人姓名
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 支付金额
    /// </summary>
    public decimal PayAmount { get; set; } = 0;
}